<?php
/* 
 * ebiz front
 * 
 * wishlist View
 * 
 * @author allen
 * 
 */
?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
    <head>
        <meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
        <title>我的收藏夹-阿基米米网上商城</title>
        <script type='text/javascript' language='javascript' src='//<?php echo ConfigConstants::$iConstants.".".DOMAIN; ?>/n/javascript/lib/jquery.js'></script>
        <script type='text/javascript' language='javascript' src='//<?php echo ConfigConstants::$iConstants.".".DOMAIN; ?>/n/javascript/lib/jquery-ui-datepicker.js'></script>
        <script type='text/javascript' language='javascript' src='//<?php echo ConfigConstants::$iConstants.".".DOMAIN; ?>/n/javascript/frontend.js'></script>
        <script type='text/javascript' language='javascript' src='//<?php echo ConfigConstants::$iConstants.".".DOMAIN; ?>/t/<?php echo $GLOBALS["config"]['template_name']; ?>/javascript/akimimi.js'></script>
        <link href='//<?php echo ConfigConstants::$iConstants.".".DOMAIN; ?>/t/<?php echo $GLOBALS["config"]['template_name']; ?>/css/style.css' rel='stylesheet' type='text/css' />   
        <link href='//<?php echo ConfigConstants::$iConstants.".".DOMAIN; ?>/t/<?php echo $GLOBALS["config"]['template_name']; ?>/css/default.css' rel='stylesheet' type='text/css' />
        <link href='//<?php echo ConfigConstants::$iConstants.".".DOMAIN; ?>/t/<?php echo $GLOBALS["config"]['template_name']; ?>/css/myaccountleftnav.css' rel='stylesheet' type='text/css' />
        <link href='//<?php echo ConfigConstants::$iConstants.".".DOMAIN; ?>/t/<?php echo $GLOBALS["config"]['template_name']; ?>/css/myaccount.css' rel='stylesheet' type='text/css' />                  
        <link href='//<?php echo ConfigConstants::$iConstants.".".DOMAIN; ?>/t/<?php echo $GLOBALS["config"]['template_name']; ?>/css/headerAndFooter.css' rel='stylesheet' type='text/css' />
    </head>
    <body>
        <?php 
            require_once '../app/views/HeaderView.php';
            echo HeaderView::getCommonHeaderView();
        ?>
        <div id="navigation">
            <a href="/">首页</a>
            <span>></span>
            <a href="/userinfo/index">我的阿基米米</a>
             > 我的收藏夹
        </div>
        <div id="mymimi_body">
	        <?php 
	            require_once '../app/views/MyAccoutLeftNavView.php';
	            echo MyAccountLeftNav::getMyAccountLeftNav();
	        ?>
            
	    <div id="mymimi_right">
	        <div class="wl_mywishlist_label">我的收藏夹</div>
            <?php if(empty($wishlistInfo)){ ?>
            <div style="color:#;text-align:center;margin-top:30px;">您的收藏夹中还没有产品，快来添加吧。</div>
            <?php } ?>
            
	        <div id="paginate"><!-- class="sub_content" -->
	            <!--产品循环开始-->
                <?php 
                    foreach ($wishlistInfo as $item) { 
                	   $urlTitle = urlencode($item["url_title"]);
                ?>
                <form method="post" id="wishlist_form_<?php echo $item["pi_id"]; ?>">
                
                <input type="hidden" id="hProductItemId_<?php echo $item["cw_id"]; ?>" value="<?php echo $item["pi_id"]; ?>" />
                <input type="hidden" id="hSalePrice_<?php echo $item["cw_id"]; ?>" value="<?php echo $item["sale_price"]; ?>" />
                <input type="hidden" id="hProductId_<?php echo $item["cw_id"]; ?>" value="<?php echo $item["p_id"]; ?>" />
                
	            <div class="wl_item_div">
	                <div class="wl_item_image">
	                    <a href="/p/<?php echo $urlTitle."/".$item["pi_id"]; ?>">
                            <?php if(empty($item["folder"]) || empty($item["name"])){ ?>
	                        <img style="width:99px;height:99px;border:0px;" alt="" src="<?php echo ConfigConstants::getDefaultProductImagePath(120); ?>" />
                            <?php }else{ ?>
	                        <img style="width:99px;height:99px;border:0px;" alt="" src="<?php echo ConfigConstants::getProductImagePath($item["folder"], $item["name"], 120); ?>" />
                            <?php } ?>
	                    </a>
	                </div>
	                <div class="wl_item_desc">
	                    <div class="wl_item_title">
	                        <a href="/p/<?php echo $urlTitle."/".$item["pi_id"]; ?>">
	                            <?php echo $item["title"]; ?>
	                        </a>
	                    </div>
	                    <div class="wl_item_common">
                        
                            <?php if(empty($item["comment"])){ ?>
                            <div id="addcomment_<?php echo $item["cw_id"]; ?>">
                                <a onclick="javascript:WishlistContent.addcommon(<?php echo $item["cw_id"]; ?>);" >+添加备注</a>
                            </div>
                            <div id="submitComment_<?php echo $item["cw_id"]; ?>" style="display:none;">
                                <input type="text" id="comment_<?php echo $item["cw_id"]; ?>" value="<?php echo $item["comment"]; ?>" /> 
                                <input type="button" value="提交" onclick="javascript:WishlistContent.subcommon(<?php echo $item["cw_id"]; ?>);" />
                            </div>
                            <div id="showComment_<?php echo $item["cw_id"]; ?>" style="display:none;">
                                <span id="wishlistCommentInfo_<?php echo $item["cw_id"]; ?>"><?php echo $item["comment"]; ?></span>
                                <input type="button" value="编辑" onclick="javascript:WishlistContent.editcommon(<?php echo $item["cw_id"]; ?>);" />
                            </div>
                            <?php }else{ ?>
                            <div id="addcomment_<?php echo $item["cw_id"]; ?>" style="display:none;">
                                <a onclick="javascript:WishlistContent.addcommon(<?php echo $item["cw_id"]; ?>);" >+添加备注</a>
                            </div>
                            <div id="submitComment_<?php echo $item["cw_id"]; ?>" style="display:none;">
                                <input type="text" id="comment_<?php echo $item["cw_id"]; ?>" value="<?php echo $item["comment"]; ?>" /> 
                                <input type="button" value="提交" onclick="javascript:WishlistContent.subcommon(<?php echo $item["cw_id"]; ?>);" />
                            </div>
                            <div id="showComment_<?php echo $item["cw_id"]; ?>">
                                <span id="wishlistCommentInfo_<?php echo $item["cw_id"]; ?>"><?php echo $item["comment"]; ?></span>
                                <input type="button" value="编辑" onclick="javascript:WishlistContent.editcommon(<?php echo $item["cw_id"]; ?>);" />
                            </div>
                            <?php } ?>

	                    </div>
	                    <div class="wl_item_time">
	                        收藏时间：<?php echo $item["created"]; ?>
	                    </div>
	                </div>
	                <div class="wl_item_price">
	                    <div style="margin-left:auto;margin-right:auto; width:60px;"><?php echo UNIT.$item["sale_price"];?></div>
	                </div>
	                <div class="wl_item_opterate">
	                    <div class="wl_cart_btn">
	                        <input type="button" value="放入购物车" onclick="javascript:WishlistContent.addToCart('<?php echo $item["cw_id"]; ?>');" />
	                    </div>
	                    <div class="wl_del_btn">
	                        <input type="button" value="取消收藏" onclick="javascript:WishlistContent.delWishlistItem('<?php echo $item["cw_id"]; ?>');" />
	                    </div>
	                </div>
	                <div class="clear"></div>
	            </div>
                </form>
	            <?php } ?>
	            <!--产品循环结束-->
                
	            <!-- 分页开始 -->
                <div class="p2_page">
                    <?php echo $headerPaginate; ?>
                </div>
	            <!-- 分页结束 -->
	            
	        </div>
	    </div>
            
            
            
            
            <!-- 
            <div id="paginate">
	            <?php print_r($wishlistInfo); ?>
	            <div class="p2_page">
	                <?php echo $headerPaginate; ?>
	            </div>
            </div>
             -->
             
            <?php 
               require_once '../app/views/FooterView.php';
               echo FooterView::getCommonFooterView();
            ?>   
        </div>
    </body>
</html>